import request from "@/utils/request";

const api_name = `/api/hosp/hospital`

export default {
  /**
   * 分页获取医院信息
   * @param page
   * @param limit
   * @param searchObj
   */
  getPageList(page, limit, searchObj) {
    return request({
      url: `${api_name}/findHospList/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  /**
   * 根据医院编号查询医院信息
   * @param hosname
   */
  getByHosname(hosname) {
    return request({
      url: `${api_name}/findByHosname/${hosname}`,
      method: 'get'
    })
  },
  /**
   * 显示医院详情
   * @param hoscode
   */
  show(hoscode) {
    return request({
      url: `${api_name}/${hoscode}`,
      method: 'get'
    })
  },
  /**
   * 根据医院编号，获取医院科室信息
   * @param hoscode
   */
  findDepartment(hoscode) {
    return request({
      url: `${api_name}/department/${hoscode}`,
      method: 'get'
    })
  },
  /**
   * 获取预约规则
   * @param page
   * @param limit
   * @param hoscode
   * @param depcode
   */
  getBookingScheduleRule(page, limit, hoscode, depcode) {
    return request({
      url: `${api_name}/auth/getBookingScheduleRule/${page}/${limit}/${hoscode}/${depcode}`,
      method: 'get'
    })
  },
  /**
   * 获取预约日期列表
   * @param hoscode
   * @param depcode
   * @param workDate
   */
  findScheduleList(hoscode, depcode, workDate) {
    return request({
      url: `${api_name}/auth/findScheduleList/${hoscode}/${depcode}/${workDate}`,
      method: 'get'
    })
  },

  /**
   * 根据id查询排班信息
   * @param id
   */
  getSchedule(id) {
    return request({
      url: `${api_name}/getSchedule/${id}`,
      method: 'get'
    })
  }

}
